﻿<form>
    <table id="listtable"></table>
</form>
<script type="text/javascript">
    var iframeid = '@ViewData["iframeid"]';
    var appid = '@ViewData["appid"]';
    var rows = @Html.Raw(ViewData["json"]);
    $(function ()
    {
        $("#listtable").jqGrid({
            datatype: "local",
            colNames: ['步骤名称', '发送人', '处理人', '接收时间', '完成时间', '状态', '处理意见', '备注', ''],
            colModel: [
                { name: 'StepID', index: 'StepID' },
                { name: 'SenderName', index: 'SenderName' },
                { name: 'ReceiveName', index: 'ReceiveName' },
                { name: 'ReceiveTime', index: 'ReceiveTime', width: 170 },
                { name: 'CompletedTime1', index: 'CompletedTime1', width: 170 },
                { name: 'Status', index: 'Status' },
                { name: 'Comment', index: 'Comment' },
                { name: 'Note', index: 'Note' },
                { name: 'Opation', index: 'Opation', title: false, width: 190 }
            ],
            //rownumbers: true,//显示序号列
            height: 430,
            rowNum: rows.length,
            width: $(window).width(),
            data: rows
        });
    });
    function back(taskid)
    {
        if (confirm("您真的要将该任务退回吗?"))
        {
            $.ajax({
                url: "Back?taskid=" + taskid + "&appid=" + appid, async: false, cache: false, success: function (txt)
                {
                    alert(txt);
                    window.location = window.location;
                }
            });
        }
    }
    function designate(taskid)
    {
        new RoadUI.Window().open({
            url: 'Designate?taskid=' + taskid + "&appid=" + appid,
            width: 500, height: 200, title: "任务指派", openerid: iframeid
        });
    }
    function goTo(taskid)
    {
        new RoadUI.Window().open({
            url: 'GoTo?taskid=' + taskid + "&appid=" + appid,
            width: 600, height: 400, title: "跳转任务", openerid: iframeid, opener: parent, resize: false
        });
    }
    function cngStatus(taskid)
    {
        new RoadUI.Window().open({
            url: 'ChangeStatus?taskid=' + taskid + "&appid=" + appid,
            width: 400, height: 200, title: "改变任务状态", openerid: iframeid, opener: parent, resize: false
        });
    }
</script>